package main

import "fmt"

// 空接口

// 空接口在 Go 语言中非常重要，它相当于 Java 中的 Object 类型，可以表示任何值
type BlankInterface interface{}

func main() {

	var anything interface{}
	anything = 42
	fmt.Printf("Value: %v, Type: %T\n", anything, anything) // Value: 42, Type: int

	var blankInterface interface{}
	blankInterface = 0.12
	fmt.Printf("Value: %v, Type: %T\n", blankInterface, blankInterface) // Value: 42, Type: int

	var obj0 = 99
	var obj1 BlankInterface = obj0
	fmt.Printf("Value: %v, Type: %T\n", obj1, obj1) // Value: 42, Type: int
}
